package com.jyx.chain;

import com.jyx.chain.filter.face.FaceFilter;
import com.jyx.chain.filter.html.HtmlFilter;
import com.jyx.chain.filter.service.ServiceFilter;
import com.jyx.chain.filterchain.FilterChain;

public class Test {

	public static void main(String[] args) {
		
		// 极限编程：先写测试，写完测试之后知道类需要什么方法，实现什么了
		String msg = "大家好:),<script>,敏感，被就业，网络授课没感觉，因为看不见大伙</script>";
		
		MsgProcessor mp = new MsgProcessor();
		mp.setMsg(msg);
		FilterChain fc = new FilterChain();
		fc.addFilter(new ServiceFilter())
			.addFilter(new HtmlFilter());
		FilterChain fc2 = new FilterChain();
		fc2.addFilter(new FaceFilter());
		
		fc.addFilter(fc2);
		
		mp.setFc(fc);
		msg = mp.process();
		System.out.println(msg);
	}

}
